package bigraph.part;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;

import bigraph.model.*;

public class AppEditPartFactory implements EditPartFactory {

	@Override
	public EditPart createEditPart(EditPart context, Object model) {
		AbstractGraphicalEditPart part = null;
		if (model instanceof Root) {
		      part = new RootPart();
		}
		else if (model instanceof Site) {
			  part = new SitePart();
		}
		else if (model instanceof Canvas) {
			  part = new CanvasPart();
		}
		else if (model instanceof Place) {
			  part = new PlacePart();
		}
		part.setModel(model);
		return part;

	}

}
